/*
 * CItemFactory.cpp
 *
 *  Created on: 13 Nov 2012
 *      Author: Mario Kleinsasser
 *		Time:	19:46:26
 */

#include "CItemFactory.h"
#include "CItem.h"
#include "CAnt.h"
#include "CAnthill.h"
#include "CFood.h"
#include <string.h>

CItem* CItemFactory::create(const char *itemtype) {

	/* Define pointer to abstract class - this is valid*/
	CItem *item;

	if (!strcmp("ant", itemtype)) {
		item = new CAnt();
		return item;
	}

	if (!strcmp("anthill", itemtype)) {
		item = new CAnthill();
		return item;
	}

	if (!strcmp("food", itemtype)) {
		item = new CFood();
		return item;
	}

	return NULL;
}

CItemFactory::CItemFactory() {
	// TODO Auto-generated constructor stub

}

CItemFactory::~CItemFactory() {
	// TODO Auto-generated destructor stub
}

